package com.zmn.plat.dubbo.interfaces.channel;

import com.zmn.common.dto.VtDTO;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.plat.common.dto.channel.ChannelOrderConfigDIO;
import com.zmn.plat.common.dto.channel.ChannelOrderConfigDRO;
import com.zmn.plat.common.dto.channel.ChannelSimpleDRO;
import com.zmn.plat.common.dto.channel.ChannelWorkOrderTypeDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.util.List;

/**
 * 描述: 渠道订单配置dubbo接口
 *
 * @author linfeng
 * @since: 2020/11/04 10:23
 */
@Api(value = "渠道订单配置服务", tags = {"渠道订单配置"})
public interface ChannelOrderConfigListRemoteService {

    /**
     * 描述: 根据渠道ID查询渠道订单配置
     *
     * @param channelId 渠道ID
     * @return ResponseDTO<ChannelOrderConfigDRO>
     * @auther: linfeng
     * @since: 2020/11/04 10:47
     */
    @ApiOperation(value = "根据渠道ID查询渠道订单配置", response = ResponseDTO.class, notes = "渠道订单配置", tags = {"渠道订单配置"})
    ResponseDTO<ChannelOrderConfigDRO> getByChannelId(@NotNull(message = "channelId不能为空") @Positive(message = "channelId必须为大于0的正整数") @ApiParam(value = "渠道ID", required = true) Integer channelId);

    /**
     * 根据渠道ID查询工单完成控制，工单取消控制，特殊优惠控制信息
     *
     * @param channelId
     * @return ResponseDTO<ChannelWorkOrderTypeDRO>
     * @auther: linfeng
     * @since 2020/12/16 16:21
     */
    @ApiOperation(value = "根据渠道ID查询工单完成/取消控制，特殊优惠控制信息", response = ResponseDTO.class, notes = "渠道订单配置", tags = {"渠道订单配置"})
    ResponseDTO<ChannelWorkOrderTypeDRO> getWorkOrderTypeByChannelId(@NotNull(message = "channelId不能为空") @Positive(message = "channelId必须为大于0的正整数") @ApiParam(value = "渠道ID", required = true) Integer channelId);


    /**
     * 根据是否允许贴花和渠道层级获取渠道信息
     *
     * @param applique 是否允许贴花 1不允许 2允许
     * @param rank     渠道层级 1一级 2二级
     * @return
     */
    @ApiOperation(value = "根据是否允许贴花和渠道层级获取渠道信息", response = ResponseDTO.class, notes = "根据是否允许贴花和渠道层级获取渠道信息", tags = {"渠道基本信息"})
    ResponseDTO<List<VtDTO>> listVtByAppliqueAndRank(@NotNull(message = "applique不能为空") @Positive(message = "applique必须为大于0的正整数") @ApiParam(value = "是否允许贴花", required = true) Integer applique,
                                                     @NotNull(message = "rank不能为空") @Positive(message = "rank必须为大于0的正整数") @ApiParam(value = "渠道层级", required = true) Integer rank);

    /**
     * 根据渠道ID查询是否需要通知工程师（工单超时预警后）
     *
     * @param channelId 渠道ID
     * @return true需要通知  false不需要通知
     */
    @ApiOperation(value = "是否通知工程师", response = ResponseDTO.class, notes = "是否通知工程师", tags = {"渠道订单配置"})
    ResponseDTO<Boolean> checkNotifyEngineer(@NotNull(message = "channelId不能为空") @Positive(message = "channelId必须为大于0的正整数") @ApiParam(value = "渠道ID", required = true) Integer channelId);

    /**
     * 根据订单配置参数以及渠道基本信息查询渠道信息
     *
     * @param channelOrderConfigDIO
     * @return the response dto
     */
    @ApiOperation(value = "根据渠道订单配置及渠道基本信息获取渠道信息", response = ResponseDTO.class, notes = "根据渠道订单配置及渠道基本信息获取渠道信息", tags = {"渠道基本信息"})
    ResponseDTO<List<ChannelSimpleDRO>> listByChannelOrderConfigDIO(@NotNull(message = "入参不能为空") @Valid @ApiParam(value = "入参", required = true) ChannelOrderConfigDIO channelOrderConfigDIO);


    /**
     * 根据渠道ID查询是否需要透传订单价格
     *
     * @param channelId 渠道ID
     * @return true允许  false不允许
     */
    @ApiOperation(value = "是否需要透传订单价格", response = ResponseDTO.class, notes = "是否需要透传订单价格", tags = {"渠道订单配置"})
    ResponseDTO<Boolean> checkShowOrderPrice(@NotNull(message = "channelId不能为空") @Positive(message = "channelId必须为大于0的正整数") @ApiParam(value = "渠道ID", required = true) Integer channelId);

    @ApiOperation(value = "查询渠道订单-列表", response = ResponseDTO.class, notes = "查询渠道订单", tags = {"查询渠道订单-列表"})
    ResponseDTO<List<ChannelOrderConfigDRO>> listQuery(@ApiParam(value = "渠道订单") ChannelOrderConfigDIO query);
}
